<html>
    <head>
        <title>成绩管理</title>
        <style>
            body {
                margin: 2em;
            }

            table {
                border-collapse: collapse;
            }

            table,
            th,
            td {
                border: 1px solid black;
                min-width: 5em;
            }
        </style>
    </head>

    <body>
        <form action="/action/grade/add" method="post">
            <label>学生序号：</label>
            <input type="text" name="stu_sn" />
            <label>课程序号：</label>
            <input type="text" name="cou_sn" />
            <label>成绩：</label>
            <input type="text" name="grade" />
            <input type="submit" value="添加成绩" />
        </form>
        <hr />
        <table>
            <tr>
                <th>姓名</th>
                <th>课程</th>
                <th>成绩</th>
                <th>操作</th>
            </tr>
            {% for item in items %}
            <tr>
                <td>{{ item.stu_name }}</td>
                <td>{{ item.cou_name }}</td>
                <td>{{ item.grade }}</td>
                <td>
                    <span>
                        <a href="/grade/edit/{{item.stu_sn}}/{{item.cou_sn}}">
                            修改
                        </a>
                    </span>
                    <span>
                        <form
                            action="/action/grade/delete/{{item.stu_sn}}/{{item.cou_sn}}"
                            method="post"
                            style="display: inline-block; margin: 5px;"
                        >
                            <input type="submit" value="删除" />
                        </form>
                    </span>
                </td>
            </tr>
            {% endfor %}
        </table>
    </body>
</html>
